package com.estagio.entity;



import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table (name="funcionario")
public class Funcionario extends Pessoa {

	@Id
	@SequenceGenerator(name="funcionario_id", sequenceName="funcionario_id_seq",allocationSize=1,initialValue = 1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="funcionario_id" )
	private Integer idFuncionario;
	
	@JoinColumn(name="idCargo")
	@ManyToOne(optional=true, fetch=FetchType.LAZY)
	private Cargo cargo;	
	@Column(length=8)
	private Date dtAdmissao;	
	@Column(length=8)
	private Date dtDemissao;	
	@Column(length=15)
	private String cref;	
	private Double salario;	
	@Column(length=20)
	private String ctps;	
	
	public Integer getIdFuncionario() {
		return idFuncionario;
	}
	public void setIdFuncionario(Integer idFuncionario) {
		this.idFuncionario = idFuncionario;
	}	

	public Date getDtAdmissao() {
		return dtAdmissao;
	}
	public void setDtAdmissao(Date dtAdmissao) {
		this.dtAdmissao = dtAdmissao;
	}
	public Date getDtDemissao() {
		return dtDemissao;
	}
	public void setDtDemissao(Date dtDemissao) {
		this.dtDemissao = dtDemissao;
	}
	
	public String getCref() {
		return cref;
	}
	public void setCref(String cref) {
		this.cref = cref;
	}
	
	public Cargo getCargo() {
		return cargo;
	}
	public void setCargo(Cargo cargo) {
		this.cargo = cargo;
	}
	
	public String getCtps() {
		return ctps;
	}
	public void setCtps(String ctps) {
		this.ctps = ctps;
	}
	public Double getSalario() {
		return salario;
	}
	public void setSalario(Double salario) {
		this.salario = salario;
	}
	
}
